package com.yanqu.road.server.cmd.activity.unionwar;

import com.yanqu.road.pb.activity.unionwar.UnionWarActivityServerProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.unionwar.UnionWarActivityModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_UNION_WAR_USER_DATA_INFO,desc = "玩家参赛信息")
public class UnionWarUserDataInfoCmd extends AbstractCommand {

    private int activityId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        UnionWarActivityServerProto.ActivityUserDataInfoReqMsg reqMsg = UnionWarActivityServerProto.ActivityUserDataInfoReqMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        player.sendPacket(Protocol.U_UNION_WAR_USER_DATA_INFO, player.getModule(UnionWarActivityModule.class).buildUserDataInfoTempBuilder(activityId));
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
